home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13863 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  989 b 

  1. Path: crl.crl.com!not-for-mail
  2. From: bobfry@crl.com (Robert Fry)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Largest effective integer.
  5. Date: 10 Apr 1996 09:29:59 -0700
  6. Organization: CRL Dialup Internet Access
  7. Message-ID: <4kgnm7$hma@crl.crl.com>
  8. References: <4ke5gu$o7u@airdmhor.gen.nz>
  9. NNTP-Posting-Host: crl.com
  10.  
  11. gumboot@airdmhor.gen.nz (Simon Hosie) writes:
  12.  
  13. >  What's the highest unsigned value you can safely represent without losing
  14. >integer accuracy using an ANSI defined type?  For example you can get as
  15. >high as 4294967295 (32 bits) using an unsigned long, or 2251800000000000ish
  16. >(51 bits) using an IEEE 8 byte real, but I don't know what the minimum
  17. >limits are for reals.
  18.  
  19. The problem is, you don't know for sure that an unsigned long is 32 bits 
  20. or that your compiler is using an IEEE 8 byte real.
  21.  
  22. >  Basically I want a really big unsigned int and I don't care what format
  23. >it's in or how slow it is.
  24.  
  25. Check out the documentation for <limits.h>
  26.  
  27. More important, look for MAXINT.
  28.  
  29.